<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Login</title>

    <link th:href="@{/lib/bootstrap-3.3.7-dist/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/lib/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css}">
    <script  th:src="@{/webjars/jquery/3.3.1-2/jquery.min.js}"></script>
    <script  th:src="@{/lib/bootstrap-3.3.7-dist/js/bootstrap.js}"></script>

    <!-- 用户/管理员登录 -->
</head>
<body>
<div th:fragment="common">
<!-- 登录窗口 -->
<div id="login" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-title">
                <h1 class="text-center">登录</h1>
            </div>

            <!-- 登录表单 -->
            <div class="modal-body">
                <form class="form-group" th:action="@{/user/login}" method="post">
                    <div class="form-group has-feedback">
                        <label for="login-account">用户名</label>
                        <div class="input-group">
								<span class="input-group-addon">
                                    <span class="glyphicon glyphicon-user"></span>
                                </span>
                            <input id="login-account" name="userName" class="form-control" placeholder="请输入用户名" maxlength="20" type="text">
                        </div>
                    </div>

                    <div class="form-group has-feedback">
                        <label for="login-password">密码</label>
                        <div class="input-group">
								<span class="input-group-addon">
									<span class="glyphicon glyphicon-lock"></span>
                                </span>
                            <input id="login-password" name="userPwd" class="form-control" placeholder="请输入密码" maxlength="20" type="password">
                        </div>
                    </div>

                    <div class="btn-group pull-left" data-toggle="buttons">
                        <label class="btn btn-default active">
                            <input name="userLevel" value="1" type="radio" checked>用户(默认)
                        </label>
                        <label class="btn btn-default">
                            <input name="userLevel" value="0" type="radio"> 管理员
                        </label>
                    </div>

                    <div class="text-right">
                        <!--<span class="text-danger">${requestScope.loginError}</span>-->
                        <!-- 2*24*60*60= 172800-->
                        <input type="checkbox" name="logintime" value="172800">记住密码&nbsp;&nbsp;
                        <button class="btn btn-primary" type="submit">登录</button>
                        <button class="btn btn-danger" data-dismiss="modal">取消</button>
                    </div>

                    <br/>
                    <a href="" data-toggle="modal" data-dismiss="modal" data-target="#register">还没有账号？点我注册</a>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 登录失败之后返回，重新打开模态框 -->
    <!--<script th:if="${session.user == null}">-->
        <!--$('#login').modal("show");-->
    <!--</script>-->
</div>
</body>
</html>